package com.qfedu.serviceImp;

import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qfedu.entity.*;
import com.qfedu.mapper.FreightMapper;
import com.qfedu.service.FreigntService;
import org.apache.zookeeper.Op;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
@org.springframework.stereotype.Service
public class FreightServiceImp implements FreigntService {

    @Autowired(required = false)
    FreightMapper freightMapper;



    //货物追踪查询根据订单id
    @Override
    public FreightEntity querycargo(String oid) {
        return freightMapper.querycargo(oid);
    }

    //根据id查询船运
    @Override
    public BoatEntity queryboat(int sid) {
        return freightMapper.queryboatbyid(sid);
    }


    //根据船id查询集装箱
    @Override
    public List<BoxEntity> querybox(int sid) {
        return freightMapper.querybox(sid);
    }

    //查询船类别
    @Override
    public BoatTypeEntity queryboattype(int soid) {
        return freightMapper.queryboxtype(soid);
    }

    //评价管理分页
    @Override
    public PageInfo<OrderEntity> querymeate(OrderEntity orderEntity) {
        PageHelper.startPage(orderEntity.getPageNum(),orderEntity.getPageSize());
        List<OrderEntity> list = freightMapper.querymeate();
        PageInfo<OrderEntity> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
